package nl.unimaas.micc.umsnooker.simulation.event;

import java.util.Random;
import java.util.Set;

import nl.unimaas.micc.umsnooker.domain.BilliardBall;

public class NoisyCueInteraction extends CueInteraction
{
	private static Random r;
	
	public static float velDev=1, transXDev=1, transYDev=1, elevDev=1, destDev=1;
	
	static
	{
		r = new Random();
	}

	public NoisyCueInteraction(float time, BilliardBall ball,
			float angDest, float angElev, float transX, float transY,
			float velocity)
	{
		super(time, ball, setAngDestNoise(angDest), setAngElevNoise(angElev), setTransXNoise(transX), setTransYNoise(transY), setVelNoise(velocity));
	}

	private static float setVelNoise(float velocity)
	{
		return (float)(velocity+velDev*r.nextGaussian());
	}

	private static float setTransYNoise(float transY)
	{
		return (float)(transY+transYDev*r.nextGaussian());
	}

	private static float setTransXNoise(float transX)
	{
		return (float)(transX+transXDev*r.nextGaussian());
	}

	private static float setAngElevNoise(float angElev)
	{
		return (float)(angElev+elevDev*r.nextGaussian());
	}

	private static float setAngDestNoise(float angDest)
	{
		return (float)(angDest+destDev*r.nextGaussian());
	}
	
	

}
